{include file="common/_meta" /}
<title></title>
</head>

<body>
    <nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>会员管理
        <span class="c-gray en">&gt;</span> 商家列表
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
            title="刷新">
            <i class="Hui-iconfont">&#xe68f;</i>
        </a>
    </nav>
    <div class="page-container">
        <div class="text-c">
            <form class="Huiform" method="get" action="">
                状态：
                <span class="select-box inline">
                    <select name="status" class="select">
                        <option value="">全部</option>
                        <option value="1">在线</option>
                        <option value="0" style="color:red;">离线</option>
                    </select>
                </span>
                <!-- 排序（降序）：
				<span class="select-box inline">
					<select name="order" class="select">
						<option value="">--默认--</option>
						<option value="create_time">-注册时间</option>
						<option value="acc_balance">-分红金额</option>
						<option value="acc_coin">-账户金币</option>
					</select>
				</span> -->
                <input type="text" class="input-text" style="width:250px" placeholder="会员姓名、手机号" id="" name="keywords" value="{$Request.get.keywords|default=''}">

                <button type="submit" class="btn btn-success radius" id="" name="">
                    <i class="Hui-iconfont">&#xe665;</i> 搜索</button>
            </form>
        </div>
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <!-- <a class="btn btn-primary radius" onclick="userAdd(1)" href="javascript:;">
				<i class="Hui-iconfont"></i> 添加会员</a> -->
            <span class="r">共有数据：
                <strong>{$list->total()}</strong> 条</span>
        </div>
        <div class="mt-20">
            <table class="table table-border  table-hover table-bg table-sort">
                <thead>
                    <tr class="text-c">
                        <th width="25">
                            <input type="checkbox" name="" value="">
                        </th>
                        <th>编号</th>
                        <th>会员信息</th>
                        <th>糖果币</th>
                        <th>KR币</th>
                        <th>回购币</th>
                        <th>商城币</th>
                        <th>信息查看</th>
                        <th>注册时间</th>
                        <th>状态</th>
                        <th width="10%">操&nbsp;&nbsp;&nbsp;&nbsp;作</th>
                    </tr>
                </thead>
                <tbody>
                    {volist name='list' id="vo"}
                    <tr class="text-c">
                        <td>
                            <input type="checkbox" value="1" name="">
                        </td>
                        <td>{$i}</td>
                        <td>
                            <a href="?pid={$vo.uid}">{$vo.name} : {$vo.tel}</a>
                        </td>
                        <td>
                            <a href="javascript:;" onclick="add(this,{$vo.uid},'tg_coin','调整[{$vo.name}]糖果币')">{$vo.tg_coin}</a>
                        </td>
                        <td>
                            <a href="javascript:;" onclick="add(this,{$vo.uid},'kr_coin','调整[{$vo.name}]kr币')">{$vo.kr_coin}</a>
                        </td>
                        <td>
                            <a href="javascript:;" onclick="add(this,{$vo.uid},'hg_coin','调整[{$vo.name}]回购币')">{$vo.hg_coin}</a>
                        </td>
                        <td>
                            <a href="javascript:;" onclick="add(this,{$vo.uid},'sc_coin','调整[{$vo.name}]商城币')">{$vo.sc_coin}</a>
                        </td>
                        <td>
                            <a href="{:url('Deal/txList')}?uid={$vo.uid}"> 交易列表</a> |
                            <a href="{:url('userAcclog')}?page=1&uid={$vo.uid}"> 账户明细</a>
                        </td>

                        <td>{$vo.create_time}</td>
                        <td class="td-status">
                            {if condition="$vo.status eq 1"}
                            <span class="label label-success radius">已启用</span>
                            {else/}
                            <span class="label label-error radius">已禁用</span>
                            {/if}
                        </td>
                        <td class="td-manage">
                            {if condition="$vo.status eq 1"}
                            <a style="text-decoration:none" onClick="us_stop(this,{$vo.uid})" href="javascript:;" title="禁用">
                                <i class="Hui-iconfont">&#xe631;</i>
                            </a>
                            {else/}
                            <a style="text-decoration:none" onClick="us_start(this,{$vo.uid})" href="javascript:;" title="激活">
                                <i class="Hui-iconfont">&#xe6a7;</i>
                            </a>
                            {/if} &nbsp;&nbsp;
                            <a style="text-decoration:none" class="ml-5" onClick="resetpwd(this,{$vo.uid})" href="javascript:;" title="重置密码">
                                <i class="Hui-iconfont">&#xe63f;</i>
                            </a>
                            &nbsp;&nbsp;
                            <a style="text-decoration:none" href="javascript:;" onClick="editInfo(this, {$vo.uid})" title="编辑">
                                <i class="Hui-iconfont">&#xe6df;</i>
                            </a>

                        </td>
                    </tr>
                    {/volist}
                </tbody>
            </table>
            <div class="pages" style="margin:20px;float: right; ">{$list->render()}</div>
        </div>
        <!-- 添加会员 -->
        <div id="user_add" class="modal fade" style="margin: 0 auto;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
            aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content radius">
                    <div class="modal-header">
                        <h3 class="modal-title"></h3>
                        <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
                    </div>
                    <div class="modal-body">
                        <article class="page-container" style="padding-right: 10%;">
                            <form action="" method="post" class="form form-horizontal" id="form-user-add">
                                <div class="row cl hidden">
                                    <label class="form-label col-xs-4 col-sm-3"></label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="uid" id="uid" class="input-text" placeholder="" autocomplete="off">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-4 col-sm-3">会员姓名：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="name" id="name" class="input-text" autocomplete="off">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-4 col-sm-3">手机号：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="tel" id="tel" class="input-text" autocomplete="off">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-4 col-sm-3">银行卡：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="bank" id="bank" class="input-text" autocomplete="off">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-4 col-sm-3">支付宝：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="alipay" id="alipay" class="input-text" autocomplete="off">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-4 col-sm-3">微信：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="wechat" id="wechat" class="input-text" autocomplete="off">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                                        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                                    </div>
                                </div>
                            </form>
                        </article>
                    </div>
                </div>
            </div>
        </div>

    </div>
    {include file="common/_footer" /}
    <!--请在下方写此页面业务相关的脚本-->
    <script type="text/javascript">
        $('select[name="status"]').val({ $Request.get.status });

        function us_stop(obj, id) {
            layer.confirm('确认要停用吗？', function (index) {
                $.ajax({
                    type: 'POST',
                    url: "{:url('User/index')}?act=status",
                    data: { 'uid': id },
                    dataType: 'json',
                    success: function (data) {
                        if (data.code) {
                            $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="us_start(this,' + id + ')" href="javascript:;" title="启用"><i class="Hui-iconfont">&#xe6e1;</i></a>');
                            $(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已禁用</span>');
                            $(obj).remove();
                        }
                        layer.msg(data.msg, { icon: 6, time: 1000 });
                    },
                    error: function (data) {
                        console.log(data.msg);
                    },
                });
            });
        }
       

    </script>
</body>

</html>